using System;
using System.Collections.Generic;
using System.Text;

namespace Tarkin.Mof.Common
{
    /// <summary>
    /// The ReflectiveSequence class is the implementation of the class as defined
    /// by section 10.7 of the Meta Object Facility (MOF) Core Specification (version 
    /// 2.0, dated January 2006).
    /// </summary>
    /// <remarks>Tarkin classes are NOT thread-safe.</remarks>
    public class ReflectiveSequence : ReflectiveCollection
    {

#region Public Methods

        public void Add ( int index, Object objectToAdd )
        {
            Objects.Insert ( index, objectToAdd );
        }

        public Object Get ( int index )
        {
            return Objects [ index ];
        }

        public Object Remove ( int index )
        {
            return Objects.RemoveAt ( index );
        }

        public Object Set ( int index, Object objectToAdd )
        {
            Objects.Insert ( index + 1, objectToAdd );

            return Objects.RemoveAt ( index );
        }

#endregion

    }
}
